package comviva.coll;

/**
* Iterator for int collections.
*
* @author Eric D. Friedman
* @version $Id: PIterator.template,v 1.1 2006/11/10 23:28:00 robeden Exp $
*/

public class TIntIterator extends TPrimitiveIterator {
   /** the collection on which the iterator operates */
   private final TIntHash _hash;

   /**
    * Creates a TIntIterator for the elements in the specified collection.
    */
   public TIntIterator(TIntHash hash) {
	super(hash);
	this._hash = hash;
   }

   /**
    * Advances the iterator to the next element in the underlying collection
    * and returns it.
    *
    * @return the next int in the collection
    * @exception NoSuchElementException if the iterator is already exhausted
    */
   public int next() {
	moveToNextIndex();
	return _hash._set[_index];
   }
}// TIntIterator